#ifndef __MISC_H__
#define __MISC_H__

struct MsAddr;
void msprintf(char* buff, int length,  const char *pFormat, ...);

long get_current_time();
long get_current_time_with_ms(long& mseconds);

set<MsAddr> one_addr(const MsAddr& addr);
template<class T>
set<MsAddr> all_addr_of_mapvar(const map<MsAddr, T>& mapVar)
{
	set<MsAddr> addrs;
	map<MsAddr, T>::const_iterator itEnd = mapVar.end();
	for(map<MsAddr, T>::const_iterator it = mapVar.begin(); it != itEnd; it++)
		addrs.insert(it->first);
	return addrs;
}

#endif //__MISC_H__
